<?php
require_once getcwd() . '/models/DayShot.php';

	class User {
	
		public $name;
		public $uid;
		public $login;
		public $access;
		public $email;
		public $phoneToken;
		public $dayshots;
		
		public function __construct($id,$name="shooter_",$login="user_"){
			$this->uid=$id;
			$this->name = $name. User::generateId();
			$this->login = $login . User::generateId();
			$this->dayshots = array();
		}
	
		public function setLogin($login){
			$this->login = $login;			
		}
		
		public function getLogin(){
			return $this->login;
		}
		
		public function setAccess($access){
			$this->access = $access;
		}
		
		public function getAccess(){
			return $this->access;
		}
		public static function generateId(){
			$code = md5(uniqid(rand(), true));
			return substr($code, 0, 10);
		}
	}


?>
